import {LGXEnums}  from "../../common/sysenum.js";

import utilfuncs from "../../common/tools/utilfuncs.js";
var funcs = utilfuncs.UtilFuncs;
var ModifySpeRectSvc = {}

ModifySpeRectSvc.drag2Modify = function (destGraph, newTransform) {
    let pos = destGraph.getPos();
    let PtInCtrlLocal = newTransform.destInverseMtx.MultT({ x: pos.x, y: pos.y, z: 0 });//求相对于控制图形局部坐标系的局部坐标
    let newWolrdPt = newTransform.newDestMtx.MultT(PtInCtrlLocal);
    pos.x = newWolrdPt.x;
    pos.y = newWolrdPt.y;

    let scale = newTransform.newDestMtx.GetS();
    let oldW = destGraph.width;
    let oldH = destGraph.height;
    destGraph.width = oldW*scale.x;
    destGraph.height = oldH*scale.y;
}

export default { ModifySpeRectSvc }